package com.dcbeida.widget;

import android.app.ProgressDialog;
import android.content.Context;
import android.widget.Toast;

import com.dcbeida.MyApplication;


/**
 * Created by mae on 15/11/19.
 */
public class DialogToast {
//    private  static ProgressDialog
    private static ProgressDialog loading;
    public static void  showLoading(Context context){
        showLoading(context, "正在加载..");
    }
    public static void  showLoading(Context context, String msg){
        if(loading != null && loading.isShowing()){
            loading.dismiss();
        }
        loading = ProgressDialog.show(context,"",msg,false,true);
    }
    public static void dismiss(){
        if(loading != null && loading.isShowing()){
            loading.dismiss();
        }
    }

    public static void showToastShort(Context c, String msg){
        Toast.makeText(c, msg, Toast.LENGTH_SHORT).show();
    }

    public static void showToastShort( String msg){
        Toast.makeText(MyApplication.getInstance(), msg, Toast.LENGTH_SHORT).show();
    }

    public static void showNoMoreMsg(Context c){
        showToastShort(c,"没有更多了..");
    }

    public static void showToastLong(Context c, String msg){
        Toast.makeText(c, msg, Toast.LENGTH_LONG).show();
    }
}
